<?php
namespace Home\Controller;
use Think\Controller;
class JoinController extends ChearkController {
    //加入购物车
    public function index(){
        $shopid = $_REQUEST['id'];//商品id
        $inforid = session('id');//用户id
        $time = date("Y-m-d H:i:s",time());//当前时间

        $data['informatio_id'] = $inforid;
        $data['J_time'] = $time;
        $data['shopsid'] = $shopid;
        $data['zhuangtai'] = "未付款";
        $res = M('purchase')->add($data);

        if(empty($res)){
            $this->redirect('Shopping/index', array('cate_id' => 2), 0);
        }else{
            $this->redirect('Shopping/index', array('cate_id' => 2), 0);
        }
        //这里直接跳到购物车

    }
    public function money(){
        $this->display('Shopping/money');
    }
    public function succes(){
        $this->display('Shopping/success');
    }
}